Wiki

Clone wiki

REACT native plugin / Installation Android

1. Add to the android/build.gradle file:

#!

allprojects {
    repositories 
    {
        google()
        jcenter()
        //... other repositories you use
        maven {
            url 'https://android-sdk.aatkit.com/maven/'
        }
        maven { url "https://s3.amazonaws.com/smaato-sdk-releases/" } //Smaato repository
        maven { url 'https://verve.jfrog.io/artifactory/verve-gradle-release' } //PubNative repository
        maven { //ironSource repository
            url 'https://android-sdk.is.com/'
        }
        maven { //Bluestack repository
            credentials {
                username "madvertise-maven"
                password "GpdGZ9GE9SK7ByWdM987"
            }
            url "https://api.bitbucket.org/2.0/repositories/mngcorp/deploy-maven-bluestack/src/master"
            authentication {
                basic(BasicAuthentication)
            }
        }
         maven { //Teads repository
            url  "https://teads.jfrog.io/artifactory/SDKAndroid-maven-prod"
        }
        //Comment out below when using optional Huawei network
        //maven { url 'https://developer.huawei.com/repo/' } //Huawei repository
    }
}

2. Enable multidex if needed. Edit the android/app/build.gradle file:

#!

android {
    defaultConfig {
        ...
        multiDexEnabled true
    }
    ...
}

dependencies {
  implementation 'androidx.multidex:multidex:2.0.1'
}

Add this code to the android/app/src/main/java/com/YOUR_PACKAGE/MainApplication.java file:

#!java

  import android.content.Context;
  import androidx.multidex.MultiDex;

  ...

  @Override
  protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
  }

Updated